import { Component, OnInit, ViewEncapsulation } from '@angular/core';
import { Overlay, BlockScrollStrategy } from '@angular/cdk/overlay';

@Component({
  selector: 'app-custom-popups',
  templateUrl: './custom-popups.component.html',
  styleUrls: ['./custom-popups.component.less'],
  encapsulation: ViewEncapsulation.None,
  preserveWhitespaces: false,
})
export class CustomPopupsComponent implements OnInit {
  isModalOpen = false;
  items = Array.from({ length: 30 }, (_, i) => i);
  scrollStrategy: BlockScrollStrategy;

  constructor(private overlay: Overlay) {
    // 禁用弹窗的滚动
    this.scrollStrategy = this.overlay.scrollStrategies.block();
  }

  ngOnInit(): void {}
  toggleModal() {
    this.isModalOpen = !this.isModalOpen;
  }
}
